<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>地址信息修改</title>
		<meta name="keywords" content="知果汇" />
		<meta name="description" content="知果汇" />
		<link rel="SHORTCUT ICON" href="_IMG_/favicon.ico" />
		<link rel="stylesheet" href="_CSS_/form.css" />
		<style type="text/css">
			html,body{height: auto;}			
			.form-control {width: 212px;}		
			select {width: 75px;border-color: #E5E5E5;}			
			.setDefault {display: block;margin-left: 75px;margin-top: 10px;color: #3377C1;text-decoration: none;}
		</style>
	</head>
	<body>
		<form id="form1" action="" method="post" class='forms'>
			<div class='form-group'>
				<label>收货人：</label>
				<input class='form-control people' type="text" value="" placeholder="请输入你的姓名"/>
			</div>
			<div class='form-group'>
				<label>电话号码：</label>
				<input class='form-control phone' type="text" value="" placeholder="请输入你的电话号码"/>
			</div>
			<div class='form-group'>
				<label>所在地区：</label>
				<span id="distpicker3">
					<select id="provice"></select>
					<select id="city"></select>
					<select id="district"></select>
				</span>
			</div>
			<div class='form-group'>
				<label>详细地址：</label>
				<input class='form-control Address' type="text"  value="" placeholder="请输入详细地址"/>
			</div>
			<div class='form-group'>
				<label>邮政编码：</label>
				<input class='form-control code' type='text' value="" placeholder="请输入当地邮政编码"/>
				<a class="setDefault" href="javascript:;"><input type="checkbox" />设置为默认地址</a>
			</div>
		</form>
	</body>
	<script src="_JS_/jquery-1.8.3.min.js"></script>
	<script src="_JS_/jquery.base64.js"></script>
	<script src="_JS_/jquery.cookie.js"></script>
	<script src="_JS_/common.js"></script>
	<script src="_JS_/distpicker.data.js"></script>
	<script src="_JS_/distpicker.js"></script>
	<script type="text/javascript">
		var url = window.location.href;
		var id = url.split("=")[1];
		$.ajax({
			type: "get",
			url: "/index.php/api/form/address_detail",
			data: {
				'id': id
			},
			dataType: 'jsonp',
			success: function (msg) {
				if (msg.code == 200) {
					$('.people').val(msg.data.nick);
					$('.Address').val(msg.data.address);
					$('.phone').val(msg.data.phone);
					$('.code').val(msg.data.code);
					if(msg.data.is_default==1){
						$('input[type="checkbox"]').attr("checked",true);
					}
					var arr=msg.data.location.split("-");
					var province = arr[0];
					var city = arr[1];
					var district = arr[2];

					$("#distpicker3").distpicker({
						placeholder:false,
						province: province,
						city: city,
						district: district
					});
				}
				if (msg.code == 1000) {
					layer.msg('网络错误！', {icon: 5});
				}
			}
		});
	</script>
</html>
